package org.ihelpuoo.weboo.checkers;

import org.ihelpuoo.lang.ArrayUtils;
import org.ihelpuoo.lang.StringUtils;

public class EnumerationChecker extends AbstractChecker
{

	private String[]	arr;

	public boolean isValid(String value)
	{
		if (StringUtils.isEmpty(value))
			return true;
		if (null == arr)
			return false;
		if (!ArrayUtils.isInArray(arr,value))
			return false;
		return true;
	}

	public void setSetting(String setting)
	{
		arr = StringUtils.splitIgnoreBlank(setting,"\\x7C");
	}

}
